﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;

namespace Demo_HHT_EARTH
{
    public partial class Closeflight : Form
    {
        SQLiteConnection cn2 = new SQLiteConnection();
        string strconinsert = String.Empty;
        public Closeflight()
        {
            InitializeComponent();
        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.Close();
            DEMO_TEMP1.MainMenu Mn = new DEMO_TEMP1.MainMenu(true,2);
            Mn.Show();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
            DEMO_TEMP1.MainMenu Mn = new DEMO_TEMP1.MainMenu(true, 2);
            Mn.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //DELETE from t_earth_flight
            try
            {
                cn2.ConnectionString = "Data Source=|DataDirectory|db.sqlite";
            }
            catch (Exception)
            {

                MessageBox.Show("notconect SQLite");
            }
            strconinsert = "DELETE from t_earth_flight";


            SQLiteCommand command = new SQLiteCommand(strconinsert, cn2);
            cn2.Open();
            command.Connection = cn2;

            command.ExecuteNonQuery();
            cn2.Close();
        }
    }
}